package ronglei.day01.demo02;
//算出 1到100 的和
public class Practice1 {
    public static void main(String[] args) {
        int addSum = sum(1,10);
        System.out.println(addSum);
    }

    //求出 几道几的和
    public static int sum (int a,int b){
        int SumData = 0;
        for (int i = a; i <= b; i++) {
            SumData+=i;
        }
        return SumData;
    }
}
